package com.yugao.fintech.antelope.statistic.api;

import com.alibaba.cloud.nacos.NacosServiceAutoConfiguration;
import com.yugao.fintech.framework.assistant.utils.exception.BizException;
import com.yugao.fintech.framework.core.response.Resp;
import com.yugao.fintech.framework.core.response.RetOps;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.cloud.openfeign.FeignAutoConfiguration;
import org.springframework.stereotype.Service;


@Service
@ConditionalOnClass({FeignAutoConfiguration.class, NacosServiceAutoConfiguration.class})
public class StatisticApiCloudImpl implements StatisticApi {
    @Autowired
    private RemoteStatisticService service;


    @Override
    public void statAccessTask() {
        Resp<?> rs = service.statAccessTask();
        RetOps.of(rs).assertSuccess(e -> new BizException(e.getCode(), e.getMsg()));
    }

    @Override
    public void statLoginTask() {
        Resp<?> rs = service.statLoginTask();
        RetOps.of(rs).assertSuccess(e -> new BizException(e.getCode(), e.getMsg()));
    }
}
